<template>
  <div class="company-container">
    <el-form
      :label-position="labelPosition"
      label-width="80px"
      :model="formLabelAlign"
      disabled
    >
      <el-form-item label="企业名称">
        <el-input v-model="formLabelAlign.name" />
      </el-form-item>
      <el-form-item label="公司地址">
        <el-input v-model="formLabelAlign.companyAddress" />
      </el-form-item>
      <el-form-item label="公司电话">
        <el-input v-model="formLabelAlign.companyPhone" />
      </el-form-item>
      <el-form-item label="邮箱">
        <el-input v-model="formLabelAlign.mailbox" />
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="formLabelAlign.remarks" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { getCompanyById } from '@/api/company'
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      labelPosition: 'right',
      formLabelAlign: {}
    }
  },
  computed: {
    ...mapGetters(['companyId'])
  },
  async created() {
    const res = await getCompanyById({ id: this.companyId })
    this.formLabelAlign = res
  }
}
</script>

<style lang="scss">
.company-container {
  .el-form {
    width: 50%;
    margin-left: 50px;
    margin-top: 30px;
  }
}
</style>
